package year2019.month01;

/**
 * @desc 描述
 * create on 2019/1/25 by watson
 */
public class MainTest25 {

    int a = 0;

    ThreadLocal<Integer> b = new ThreadLocal<>();


    public static void main(String[] args){
        MainTest25 test25 = new MainTest25();
        test25.b.set(0);

        Thread t1 = new Thread(() -> {
            test25.a=1;
            test25.b.set(1);
            System.out.println("a\t"+test25.a+"\tb\t"+test25.b.get());
        });

        Thread t2 = new Thread(() -> {
            test25.a=2;
            test25.b.set(2);
            System.out.println("a\t"+test25.a+"\tb\t"+test25.b.get());
        });

        Thread t3 = new Thread(() -> {
            test25.a=3;
            test25.b.set(3);
            System.out.println("a\t"+test25.a+"\tb\t"+test25.b.get());
        });

        Thread t4 = new Thread(() -> {
            test25.a=4;
            test25.b.set(4);
            System.out.println("a\t"+test25.a+"\tb\t"+test25.b.get());
        });

        Thread t5 = new Thread(() -> {
            test25.a=5;
            test25.b.set(5);
            System.out.println("a\t"+test25.a+"\tb\t"+test25.b.get());
        });

        Thread t6 = new Thread(() -> {
            test25.a=6;
            test25.b.set(6);
            System.out.println("a\t"+test25.a+"\tb\t"+test25.b.get());
        });

        Thread t7 = new Thread(() -> {
            test25.a=7;
            test25.b.set(7);
            System.out.println("a\t"+test25.a+"\tb\t"+test25.b.get());
        });

        Thread t8 = new Thread(() -> {
            test25.a=8;
            test25.b.set(8);
            System.out.println("a\t"+test25.a+"\tb\t"+test25.b.get());
        });

        Thread t9 = new Thread(() -> {
            test25.a=9;
            test25.b.set(9);
            System.out.println("a\t"+test25.a+"\tb\t"+test25.b.get());
        });

        Thread t10 = new Thread(() -> {
            test25.a=10;
            test25.b.set(10);
            System.out.println("a\t"+test25.a+"\tb\t"+test25.b.get());
        });

        Thread t11 = new Thread(() -> {
            test25.a=11;
            test25.b.set(11);
            System.out.println("a\t"+test25.a+"\tb\t"+test25.b.get());
        });

        Thread t12 = new Thread(() -> {
            test25.a=12;
            test25.b.set(12);
            System.out.println("a\t"+test25.a+"\tb\t"+test25.b.get());
        });

        t1.start();
        t2.start();
        t3.start();
        t4.start();
        t5.start();
        t6.start();
        t7.start();
        t8.start();
        t9.start();
        t10.start();
        t11.start();
        t12.start();


    }

}
